package cn.com.oidreams.aliyun.robot.enums;

import cn.com.oidreams.aliyun.robot.entity.*;
import cn.com.oidreams.aliyun.robot.service.*;
import cn.com.oidreams.aliyun.robot.service.interfaces.IRobot;
import cn.com.oidreams.common.enums.ICommonEnum;
import lombok.Getter;

/***
 ** @category 钉钉Talk枚举
 ** @author qing.yunhui
 ** @email: qingyh@glodon.com
 ** @createTime: 2021-11-24 11:06
 **/
public class DingTalkEnum {

    @Getter
    /**
     * <p>消息类型</p>
     * */
    public enum MSG_TYPE implements ICommonEnum {
        TEXT( "text","文本消息", TextMsgService.class,TextMsgRequest.class),
        LINK("link","带URL链接的消息", LinkMsgService.class,LinkMsgRequest.class),
        MARKDOWN("markdown","markdown消息", MarkDownMsgService.class,MarkDownMsgRequest.class),
        ACTION_CARD("actionCard","ActionCard消息", ActionCardMsgService.class,ActionCardMsgRequest.class),
        FEED_CARD("feedCard","feedCard消息");
        private final String code;
        private final String value;
        private final Class<?extends AbsDingTalkMessage> service;
        private final Class<?extends BaseRequest> request;
        MSG_TYPE(String code, String value){ this(code,value,null,null); }
        MSG_TYPE(String code, String value,Class<?extends AbsDingTalkMessage> service,Class<?extends BaseRequest> request) {
            this.code = code;
            this.value = value;
            this.service=service;
            this.request=request;
        }
        @Override
        public Integer getKey() { return null; }
    }
    /**
     * <p>按钮排列方向</p>
     * */
    @Getter
    public enum BTN_ORIENTATION implements ICommonEnum{
        VERTICAL("0","按钮竖直排列"),
        STANDARD("1","按钮横向排列");
        private final String code;
        private final String value;
        BTN_ORIENTATION(String code, String value) {
            this.code = code;
            this.value = value;
        }
        @Override
        public Integer getKey() { return null; }
    }

    /**
     * <p>机器人</p>
     * */
    @Getter
    public enum ROBOT implements IRobot {
        XIAO_ZHI("fa8758e27ba2c7e025d249ea4d2d7307acd5104f2037c7f99e51fadf7028fac4e","SEC7108f2612040bca75446f4942abe9cb79e53a60c94d415ed9fc247e56207a7e41","小智","apple","[苹果-群]"),
        LITTLE_LOVE("d7a7beb4a72391aef9c46d0ef1fc439bf30c9aba06573eaf41a6fa069a49a2743","SEC05c9cecea6d76833ee375a85c64f92788b659f79f11879eda70438252f91ec247","小爱","apple","[苹果-群]"),
        XIAO_TIAN("4eb6d2699829892bb861c1ddf0ac7c6b21bc0730d70f6a6d9c4e790869d3d9447","SEC2e0d327935bf93ff7f9b8bddf54d9ad20305f55e3deafaf07f04ea8d64d298145","小天","apple","[苹果-群]");
        private final String accessToken;
        /**
         * <p>机器人密钥</p>
         * */
        private final String code;
        /**
         * <p>机器人名称</p>
         * */
        private final String value;
        private final String groupCode;
        private final String groupName;
        ROBOT(String accessToken,String code, String value,String groupCode,String groupName) {
            this.accessToken=accessToken;
            this.code = code;
            this.value = value;
            this.groupCode=groupCode;
            this.groupName=groupName;
        }
        @Override
        public Integer getKey() { return null; }
        @Override
        public String getGroupCode() { return groupCode; }
        @Override
        public String getGroupName() { return groupName; }
        @Override
        public String getAccessToken() { return accessToken; }
    }

}
